<template>
<t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
    </t-image-viewer>
    <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
    </van-image-preview>
  <div class="outline-parent jy-style-height border-hover-style outline-style2">
    
    <t-popup
      class="placement bottom center"
      attach="#attach"
      content="查看本单元全景展厅"
      placement="bottom"
      showArrow
      destroyOnClose
    >
      <img
        v-if="props.info.digitalShowroom"
        class="icon-3d blinking-animation-style"
        id="outlineIcon"
        @click="open(props.info.digitalShowroom)"
        :src="publicUrls + 'free/style2/3dIcon.png'"
      />
    </t-popup>
    <img class="outline-parent-bg" :src="publicUrls + 'free/style2/Level1outline2Style1Bg.png?imageView2/3/format/webp'" alt="" />
    <div class="outline jy-style-height">
      <div class="outline-content">
        <div class="content-tiitle" :class="props.info.text?.length <= 2 && 'writingMode'">
          {{ props.info.text }}
        </div>
        <div class="line"></div>
        <p class="outline-subTitle" v-if="props.info.subTitle">{{ props.info.subTitle }}</p>
        <TextMax
          :data="props.info.remarks"
          :infoData="props.info"
          :title="props.info.text"
          :row="props.info.value ? 6 : 15"
        ></TextMax>
        <div class="cover" v-if="props.info.value" :class="!props.info.remarks && 'cover-line'">
          <img
            class="outline-cover"
            @click="ImgVisible = true"
            :src="urls + props.info.value + '?imageView2/3/format/webp'"
            alt=""
          />
        </div>
      </div>
    </div>
    <img class="shadow" :src="publicUrls + 'free/style2/firstLevelOutline1Shadow.png?imageView2/3/format/webp'" alt="" />
  </div>
</template> 

<script lang="ts">
export default defineComponent({
  name: 'free2Style2',
});
</script>

<script setup lang="ts">
import { publicUrls } from '@/utils/minxin';
import { getTextHtml } from '@/utils/minxin';
import { urls } from '@/utils/request/upload';
import { defineComponent, ref } from 'vue';
import TextMax from '@/freeComponents/textMode/TextMax.vue';
import { useProjectStore } from '@/store';

const ImgVisible = ref(false);
const store = useProjectStore();

const props = defineProps({
  info: {
    type: Object,
  },
});

// 跳转全景链接
const open = (url: any) => {
  if (url) {
    window.open(url, '_blank');
  }
};
</script>

<style scoped lang="less">
.outline-parent {
  position: relative;
  margin-right: 90px;
  margin-top: 0;
  margin-left: 120px;
  .shadow {
    width: 680px;
    height: 210px;
    position: absolute;
    bottom: 0;
    left: 0;
  }
  .icon-3d {
    width: 48px;
    height: 58px;
    object-fit: contain;
    position: absolute;
    top: -6px;
    right: 60px;
    z-index: 21;
  }
}
.outline-parent-bg {
  width: 490px;
  height: 100%;
  position: relative;
  z-index: 20;
}
.outline {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  padding: 116px 60px 118px 51px;
}
.outline-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.writingMode {
  display: flex;
  align-items: flex-end;
  writing-mode: tb-rl;
  flex-shrink: 0;
}
.content-tiitle {
  width: 100%;
  position: relative;
  font-family: ZKTSHIKTS--GB1, ZKTSHIKTS--GB1;
  line-height: 40px;
  font-size: 44px;
  color: #353e3e;
}

.outline-subTitle {
  font-family: SourceHanSerifCN, SourceHanSerifCN;
  font-size: 18px;
  color: #212326;
  line-height: 28px;
  opacity: 80%;
  margin-bottom: 16px;
  opacity: 0.8;
}
.line {
  width: 100%;
  height: 1px;
  background: #212326;
  opacity: 0.6;
  margin: 28px 0 16px 0;
  flex-shrink: 0;
}
.cover {
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;
  position: relative;
  margin-top: 16px;
  padding-top: 32px;
  overflow: hidden;
  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    opacity: 0.6;
    background: #212326;
  }
  img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
}

.cover-line {
  padding-top: 16px !important;
  &::after {
    content: '';
    position: absolute;
    bottom: -14px;
    left: 0;
    width: 100%;
    height: 1px;
    opacity: 0.6;
    background: #212326;
  }
  &::before {
    height: 0;
  }
}

::v-deep .van-text-ellipsis {
  font-family: SourceHanSerifCN-Medium !important;
  font-size: 18px !important;
  color: rgba(33, 35, 38, 0.6) !important;
  line-height: 32px !important;
}
::v-deep .van-text-ellipsis__action::before {
  color: #ffdc76 !important;
  font-weight: 400 !important;
  text-decoration-line: underline;
}
::v-deep .t-popup__content {
  background: #5b8c87;
  box-shadow: none;
  padding: 4px 10px;
  font-size: 14px !important;
  line-height: 22px;
  color: #fff;
  box-shadow: 0px 5px 5px -3px rgba(0, 0, 0, 0.1), 0px 8px 10px 1px rgba(0, 0, 0, 0.06),
    0px 3px 14px 2px rgba(0, 0, 0, 0.05);
}
::v-deep .t-popup__arrow::before {
  background: #5b8c87;
  border: none;
  box-shadow: none !important;
}
</style>